package me.idashu.attg.service;

import java.util.List;
import java.util.Map;

import me.idashu.attg.domain.MessageEntity;
import me.idashu.attg.persistence.MessageMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MessageService {
	@Autowired
	private MessageMapper messageMapper;

	public void insertMessage(MessageEntity messageEntity){
		messageMapper.insertMessage(messageEntity);
	}
	
	public List<MessageEntity> findMessagesByUser(Map<String, Object> map){
		List<MessageEntity> messages = messageMapper.findMessagesByUser(map);
		return messages;
	}
	
	public int findCountMessagesByUser(MessageEntity messageEntity){
		int count = messageMapper.findCountMessagesByUser(messageEntity);
		return count;
	}
}
